package com.ccp.dev.system.service;

import com.ccp.dev.core.basic.base.BaseService;
import com.ccp.dev.system.dao.ResourcesUrlDao;
import com.ccp.dev.system.model.ResourcesUrl;
import com.ccp.dev.system.model.ResourcesUrlExt;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 资源URL Service类
 * @author y
 */
@Service
public class ResourcesUrlService extends BaseService<ResourcesUrl>
{
	@Resource
	private ResourcesUrlDao resourcesUrlDao;

	/**
	 * 根据系统别名和url获取角色和url映射关系
	 * @param aliasList 子系统别名list
	 * @param url	请求url
	 * @return list
	 */
	@SuppressWarnings("unchecked")
	public List<ResourcesUrlExt> queryUrlAndRoleByUrlSystemAliasList(List<String> aliasList, String url){
		Map<String,Object> params=new HashMap<>();
		params.put("aliasList", aliasList);
		params.put("url", url);
		return this.resourcesUrlDao.queryUrlAndRoleByUrlSystemAliasList(params);
	}
}
